package com.sky.mapper;

import com.sky.entity.SetmealDish;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {


    /**
     * 批量查询套餐-商品关联表，根据商品id查询
     *
     * @param dishIds
     * @return
     */
    List<Long> batchQuerySetmealIdsByDishIds(List<Long> dishIds);

    /**
     * 批量添加商品-套餐 关联表
     *
     * @param setmealDishes
     */
    void batchInsert(List<SetmealDish> setmealDishes);

    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> queryBySetmealId(Long setmealId);

    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);

    void batchDeleteBySetmealIds(List<Long> setmealIds);
}
